package com.sizu.web;


import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sizu.common.saledto.TCustomerReturnListGoodsDto;
import com.sizu.common.saledto.TSaleListGoodsDto;
import com.sizu.common.vo.ResultEntity;
import com.sizu.entity.TCustomerReturnListGoods;
import com.sizu.entity.TSaleListGoods;
import com.sizu.service.ITCustomerReturnListGoodsService;
import com.sizu.service.ITSaleListGoodsService;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 赵玉玺
 * @since 2020-02-26
 */
@RestController
@RequestMapping("/sale/tCustomerReturnListGoods")
public class TCustomerReturnListGoodsController {

    @Resource
    private ITCustomerReturnListGoodsService iTCustomerReturnListGoodsService;


    /**
     * 返回详情列表用于做修改
     * @param tCustomerReturnListGoodsDto
     * @return
     */
    @RequestMapping("/list")
    public ResultEntity tCustomerReturnListGoodsList(TCustomerReturnListGoodsDto tCustomerReturnListGoodsDto){
        TCustomerReturnListGoods tCustomerReturnListGoods=new TCustomerReturnListGoods();
        BeanUtils.copyProperties(tCustomerReturnListGoodsDto,tCustomerReturnListGoods);
        Wrapper<TCustomerReturnListGoods> wrapper=new EntityWrapper<>(tCustomerReturnListGoods);
        List<TCustomerReturnListGoods> tCustomerReturnListGoodss = iTCustomerReturnListGoodsService.selectList(wrapper);
        return ResultEntity.ok("查询成功",tCustomerReturnListGoodss);
    }
}
